// 云对象教程: https://uniapp.dcloud.net.cn/uniCloud/cloud-obj
// jsdoc语法提示教程：https://ask.dcloud.net.cn/docs/#//ask.dcloud.net.cn/article/129
module.exports = {
	_before: function () { // 通用预处理器

	},
	// 图包订单 ny-picture-indent
	// 添加订单
	async addpictureIndent(item) {
		const db = uniCloud.database();
		const collection = db.collection("ny-picture-indent");
		const res = await collection.add(item)
		return {
			code: 200,
			msg: '添加成功!!',
			data: res
		}
	},
	// 查找订单
	async loopictureIndent(item) {
		const db = uniCloud.database();
		const collection = db.collection("ny-picture-indent");
		let res = await collection.where({
			"userid": item
		}).get()
		return {
			code: 200,
			msg: '查找成功!!',
			data: res.data
		}
	},
	async loopictureIndentall(item) {
		const db = uniCloud.database();
		const collection = db.collection("ny-picture-indent");
		let res = await collection.where(item).get()
		return {
			code: 200,
			msg: '查找成功!!',
			data: res.data
		}
	},
	// 修改订单
	async updatepictureIndent(_id, item) {
		const db = uniCloud.database();
		const collection = db.collection("ny-picture-indent");
		let res = await collection.doc(_id).update(item)
		return {
			code: 200,
			msg: '修改成功!!',
			data: res
		}
	},
}
